package com.insigma.business.qrcode.soldier.util;


import com.insigma.business.qrcode.common.dto.BaseTotalBSearcher;

import java.util.Iterator;
import java.util.List;


public interface IScrollGet<T> {
    int DEFAULT_PAGE_SIZE = 100;

    
    List<T> scrollGetFunc(Integer pageNo);

    default Iterator<T> getDataIterator(BaseTotalBSearcher queryParam) {
        return getDataIterator(queryParam);
    }

    default Iterator<T> getDataIterator() {
        return IteratorWrapUtils.wrapPageGetApiToIterator(
                (lastItem) -> scrollGetFunc(lastItem));
    }
}
